package com.lh.controller;

import com.alibaba.fastjson.JSONObject;
import com.lh.entity.table.LeadLeader;
import com.lh.entity.table.ResponsiblePerson;
import com.lh.service.ResponsiblePersonService;
import com.lh.utils.Answer;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/responsiblePerson")
public class ResponsiblePersonController {
    @Resource
    private ResponsiblePersonService responsiblePersonService;

    @RequestMapping("/getResponsiblePersonPage")
    public Answer<Object> getResponsiblePersonPage(@RequestBody JSONObject reqJson) {
        return responsiblePersonService.getResponsiblePersonPage(reqJson);
    }

    @RequestMapping("/getResponsiblePersonList")
    public Answer<Object> getResponsiblePersonList() {
        return responsiblePersonService.getResponsiblePersonList();
    }

    @RequestMapping("/addResponsiblePerson")
    public Answer<Object> addResponsiblePerson(@RequestBody ResponsiblePerson responsiblePerson) {
        return responsiblePersonService.addResponsiblePerson(responsiblePerson);
    }

    @RequestMapping("/updateResponsiblePerson")
    public Answer<Object> updateResponsiblePerson(@RequestBody ResponsiblePerson responsiblePerson) {
        return responsiblePersonService.updateResponsiblePerson(responsiblePerson);
    }

    @RequestMapping("/deleteResponsiblePersonById")
    public Answer<Object> deleteResponsiblePersonById(@RequestBody JSONObject reqJson) {
        return responsiblePersonService.deleteResponsiblePersonById(reqJson);
    }
}
